﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.ComponentModel;
namespace WPFExcelReport
{
    public partial class K9315
    {
        public K9315()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            InitializeComponent();
            SDSA = "9315";
        }
        public override void LOADALL()
        {
            base.LOADALL();
            foreach (DataRow row in TBMain.Rows)
            {
                row["SDES"] = Helpers.Helper.Convert8859P1ToGB2312(row["SDES"].ToString().Trim());
                row["DES"] = Helpers.Helper.Convert8859P1ToGB2312(row["DES"].ToString().Trim());
            }
            if (SDSA.Length == 0) return;
            if (TBMain.Rows.Count > 0)
                return;
             dwData = TBMain.NewRow();
            TMV.SetUpNewRow(ref dwData, SDSA);
            dwData["KEY"]=Helpers.Helper.ConvertGB2312To8859P1("J");
            dwData["DES"]=Helpers.Helper.ConvertGB2312To8859P1("精梳");
            dwData["SDES"]=Helpers.Helper.ConvertGB2312To8859P1("精梳");
            dwData["VALUE"]=Helpers.Helper.ConvertGB2312To8859P1("000000000"); 
            TMV.Save(dwData);
            dwData["KEY"]=Helpers.Helper.ConvertGB2312To8859P1("P");
            dwData["DES"]=Helpers.Helper.ConvertGB2312To8859P1("普梳");
            dwData["SDES"]=Helpers.Helper.ConvertGB2312To8859P1("普梳");
            dwData["VALUE"]=Helpers.Helper.ConvertGB2312To8859P1("000000000"); 
            TMV.Save(dwData); 
            LOADALL();
        }
    }
}
